package fr.lip6.meta.ple.plextraction;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import org.eclipse.emf.ecore.EObject;

import artefact.generic.Artefact;
import fr.lip6.meta.tools.SequenceConstructionGenerator;
import fr.lip6.meta.tools.UMLLoader;



public class MainTestCaseArgoUML {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//System.out.println("Test");
		ArrayList<Artefact> artefacts = new ArrayList<Artefact>();
		
		
		
		int i=1;
		/*
		 * ActivityDisabled.uml
		 */
		
			SequenceConstructionGenerator mygen = new SequenceConstructionGenerator();
			UMLLoader myloader = UMLLoader.getInstance();
			String fileName = "generated/argouml/ActivityDisabled.uml";
			List<EObject> resList = null;
			
			File f = new File(fileName);
			try {
				/** CHARGER UN MODEL D'UN FICHIER XMI **/
				//System.out.println("Loading UML from file " + fileName);
				resList = myloader.loadUMLFromFile(f);
				//System.out.println("Generating code...");
				mygen.generate(resList);

			} catch (IOException e) {
				e.printStackTrace();
			}
			Artefact   ar = mygen.getProduct();
			ar.setId(i);
			artefacts.add(ar);
			i++;

			
			/*
			 * AllDisabled.uml
			 */
			
				SequenceConstructionGenerator mygen2 = new SequenceConstructionGenerator();
				UMLLoader myloader2 = UMLLoader.getInstance();
				String fileName2 = "generated/argouml/AllDisabled.uml";
				List<EObject> resList2 = null;
				
				File f2 = new File(fileName2);
				try {
					/** CHARGER UN MODEL D'UN FICHIER XMI **/
					//System.out.println("Loading UML from file " + fileName2);
					resList2 = myloader2.loadUMLFromFile(f2);
					//System.out.println("Generating code...");
					mygen2.generate(resList2);

				} catch (IOException e) {
					e.printStackTrace();
				}
				Artefact   ar2 = mygen2.getProduct();
				ar2.setId(i);
				artefacts.add(ar2);
				i++;

		
				/*
				 * CognitiveDisabled.uml
				 */
				
					SequenceConstructionGenerator mygen3 = new SequenceConstructionGenerator();
					UMLLoader myloader3 = UMLLoader.getInstance();
					String fileName3 = "generated/argouml/CognitiveDisabled.uml";
					List<EObject> resList3 = null;
					
					File f3 = new File(fileName3);
					try {
						/** CHARGER UN MODEL D'UN FICHIER XMI **/
						//System.out.println("Loading UML from file " + fileName3);
						resList3 = myloader3.loadUMLFromFile(f3);
						//System.out.println("Generating code...");
						mygen3.generate(resList3);

					} catch (IOException e) {
						e.printStackTrace();
					}
					Artefact   ar3 = mygen3.getProduct();
					ar3.setId(i);
					artefacts.add(ar3);
					i++;

					
					/*
					 * CollabDisabled.uml
					 */
					
						SequenceConstructionGenerator mygen4 = new SequenceConstructionGenerator();
						UMLLoader myloader4 = UMLLoader.getInstance();
						String fileName4 = "generated/argouml/CollabDisabled.uml";
						List<EObject> resList4 = null;
						
						File f4 = new File(fileName4);
						try {
							/** CHARGER UN MODEL D'UN FICHIER XMI **/
							//System.out.println("Loading UML from file " + fileName4);
							resList4 = myloader4.loadUMLFromFile(f4);
							//System.out.println("Generating code...");
							mygen4.generate(resList4);

						} catch (IOException e) {
							e.printStackTrace();
						}
						Artefact   ar4 = mygen4.getProduct();
						ar4.setId(i);
						artefacts.add(ar4);
						i++;
						
						
						/*
						 * DeployDisabled.uml
						 */
						
							SequenceConstructionGenerator mygen5 = new SequenceConstructionGenerator();
							UMLLoader myloader5 = UMLLoader.getInstance();
							String fileName5 = "generated/argouml/DeployDisabled.uml";
							List<EObject> resList5 = null;
							
							File f5 = new File(fileName5);
							try {
								/** CHARGER UN MODEL D'UN FICHIER XMI **/
								//System.out.println("Loading UML from file " + fileName5);
								resList5 = myloader5.loadUMLFromFile(f5);
								//System.out.println("Generating code...");
								mygen5.generate(resList5);

							} catch (IOException e) {
								e.printStackTrace();
							}
							Artefact   ar5 = mygen5.getProduct();
							ar5.setId(i);
							artefacts.add(ar5);
							i++;
					
							/*
							 * LoggingDisabled.uml
							 */
							
								SequenceConstructionGenerator mygen6 = new SequenceConstructionGenerator();
								UMLLoader myloader6 = UMLLoader.getInstance();
								String fileName6 = "generated/argouml/LoggingDisabled.uml";
								List<EObject> resList6 = null;
								
								File f6 = new File(fileName6);
								try {
									/** CHARGER UN MODEL D'UN FICHIER XMI **/
									//System.out.println("Loading UML from file " + fileName6);
									resList6 = myloader6.loadUMLFromFile(f6);
									//System.out.println("Generating code...");
									mygen6.generate(resList6);

								} catch (IOException e) {
									e.printStackTrace();
								}
								Artefact   ar6 = mygen6.getProduct();
								ar6.setId(i);
								artefacts.add(ar6);
								i++;
							
						
								/*
								 * Original.uml
								 */
								
									SequenceConstructionGenerator mygen7 = new SequenceConstructionGenerator();
									UMLLoader myloader7 = UMLLoader.getInstance();
									String fileName7 = "generated/argouml/LoggingDisabled.uml";
									List<EObject> resList7 = null;
									
									File f7 = new File(fileName7);
									try {
										/** CHARGER UN MODEL D'UN FICHIER XMI **/
										//System.out.println("Loading UML from file " + fileName7);
										resList7 = myloader7.loadUMLFromFile(f7);
										//System.out.println("Generating code...");
										mygen7.generate(resList7);

									} catch (IOException e) {
										e.printStackTrace();
									}
									Artefact   ar7 = mygen7.getProduct();
									ar7.setId(i);
									artefacts.add(ar7);
									i++;
							
									
									/*
									 * SequenceDisabled.uml
									 */
									
										SequenceConstructionGenerator mygen8 = new SequenceConstructionGenerator();
										UMLLoader myloader8 = UMLLoader.getInstance();
										String fileName8 = "generated/argouml/SequenceDisabled.uml";
										List<EObject> resList8 = null;
										
										File f8= new File(fileName8);
										try {
											/** CHARGER UN MODEL D'UN FICHIER XMI **/
											//System.out.println("Loading UML from file " + fileName8);
											resList8 = myloader8.loadUMLFromFile(f8);
											//System.out.println("Generating code...");
											mygen8.generate(resList8);

										} catch (IOException e) {
											e.printStackTrace();
										}
										Artefact   ar8 = mygen8.getProduct();
										ar8.setId(i);
										artefacts.add(ar8);
										i++;
								
										/*
										 * StateDisabled.uml
										 */
										
											SequenceConstructionGenerator mygen9 = new SequenceConstructionGenerator();
											UMLLoader myloader9 = UMLLoader.getInstance();
											String fileName9 = "generated/argouml/StateDisabled.uml";
											List<EObject> resList9 = null;
											
											File f9= new File(fileName9);
											try {
												/** CHARGER UN MODEL D'UN FICHIER XMI **/
												//System.out.println("Loading UML from file " + fileName9);
												resList9 = myloader9.loadUMLFromFile(f9);
												//System.out.println("Generating code...");
												mygen9.generate(resList9);

											} catch (IOException e) {
												e.printStackTrace();
											}
											Artefact   ar9 = mygen9.getProduct();
											ar9.setId(i);
											artefacts.add(ar9);
											i++;
										
											/*
											 * UsecaseDisabled.uml
											 */
											
												SequenceConstructionGenerator mygen10 = new SequenceConstructionGenerator();
												UMLLoader myloader10 = UMLLoader.getInstance();
												String fileName10 = "generated/argouml/UsecaseDisabled.uml";
												List<EObject> resList10 = null;
												
												File f10= new File(fileName10);
												try {
													/** CHARGER UN MODEL D'UN FICHIER XMI **/
													//System.out.println("Loading UML from file " + fileName10);
													resList10 = myloader10.loadUMLFromFile(f10);
													//System.out.println("Generating code...");
													mygen10.generate(resList10);

												} catch (IOException e) {
													e.printStackTrace();
												}
												Artefact   ar10 = mygen10.getProduct();
												ar10.setId(i);
												artefacts.add(ar10);
												i++;
											
			
		//Extract.extract(ExampleClassDiagramCreation.createBankClassDiagrams());
		//Extract.extract(artefacts,"argouml");
		System.err.println("Fin!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");


	}

}
